package com.apes.util;




import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.List;

/**
 * 功能：树
 *
 * @author zhuyh
 * @time   14:21
 * @date   2018/8/7
 */
public class TreeUtil<T> {

    private String id;

    private String parent;

    private String label;

    private String data;

    private String expandedIcon;

    private String collapsedIcon;

    private String icon;

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    private List<TreeUtil<T>> children=new ArrayList<TreeUtil<T>>();


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getExpandedIcon() {
        return expandedIcon;
    }

    public void setExpandedIcon(String expandedIcon) {
        this.expandedIcon = expandedIcon;
    }

    public String getCollapsedIcon() {
        return collapsedIcon;
    }

    public void setCollapsedIcon(String collapsedIcon) {
        this.collapsedIcon = collapsedIcon;
    }

    public List<TreeUtil<T>> getChildren() {
        return children;
    }

    public void setChildren(List<TreeUtil<T>> children) {
        this.children = children;
    }


    public TreeUtil(String id, String parent, String label, String data, String expandedIcon, String collapsedIcon, String icon, List<TreeUtil<T>> children) {
        this.id = id;
        this.parent = parent;
        this.label = label;
        this.data = data;
        this.expandedIcon = expandedIcon;
        this.collapsedIcon = collapsedIcon;
        this.icon = icon;
        this.children = children;
    }

    public TreeUtil() {
        super();
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
